using System.Collections;
using Reflector.CodeModel;

namespace LanguageWriterHelper
{
    public class Language : ILanguage
    {
        
        public ILanguageWriter GetWriter(IFormatter formatter, ILanguageWriterConfiguration configuration)
        {
            return new LanguageWriter(formatter, configuration);
        }
        
        public string FileExtension
        {
            get
            {
                return ".xml";
            }
        }

        public string Name
        {
            get
            {
                return "Helper";
            }
        }

        public bool Translate
        {
            get
            {
                return true;
            }
        }

        /// <summary>
        /// Configuration holder for the langauge writer
        /// </summary>
        private class LanguageWriterConfiguration : ILanguageWriterConfiguration
        {
            private IVisibilityConfiguration visibility;
            private IDictionary table = new Hashtable();

            /// <summary>
            /// Gets or sets the visibility.
            /// </summary>
            /// <value>The visibility.</value>
            public IVisibilityConfiguration Visibility
            {
                get
                {
                    return this.visibility;
                }

                set
                {
                    this.visibility = value;
                }
            }

            /// <summary>
            /// Gets or sets the <see cref="System.String"/> with the specified name.
            /// </summary>
            /// <value></value>
            public string this[string name]
            {
                get
                {
                    return (string)this.table[name];
                }

                set
                {
                    this.table[name] = value;
                }
            }
        }
    }
}